package com.example.jdai.jdai.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.jdai.jdai.MyApplication;
import com.example.jdai.jdai.R;
import com.example.jdai.jdai.rest.BackRest;
import com.example.jdai.jdai.util.DataAll;

import java.util.Map;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class AboutActivity extends Activity implements BackRest.DoLong{

    @BindView(R.id.tb)
    TopBar tb;
    @BindView(R.id.tv_about)
    TextView tvAbout;
    @BindView(R.id.activity_about)
    LinearLayout activityAbout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        ButterKnife.bind(this);
        tvAbout.setText(MyApplication.dataAll.data.get(DataAll.ABOUT));
        MyApplication.backRest.getAbout(this);
        tb.setTopBarLisener(new TopBar.TopBarLisener() {
            @Override
            public void back() {
                finish();
            }

            @Override
            public void more() {

            }
        });
    }


    @Override
    public void doDone(int mark, Map str) {
        switch (mark){
            case 0:
                tvAbout.setText((String)str.get("tip"));
        }
    }
}
